# -*- coding: utf-8 -*-

"""
@Datetime: 2019/5/21
@Author: Zhang Yafei
"""
# 4! = 4*3*2*1
# 5! = 5*4*3*2*1
# 方式一
# i = 1
# result = 1
# j = int(input("请输入一个数字:"))
# while i <= j:
#     result = result * i
#     i += 1
# print("%d! = %d" % (j, result))

# 方式二 递归
def get_nums(num):
    if num > 1:
        num = num * get_nums(num - 1)
        return num
    else:
        return num


a = int(input("请输入一个数字:"))

b = get_nums(a)
print("%d! = %d" % (a, b))


# def test():
#     print("haha")
#     test()
#
#
# test()
